<div class="refentry"><a id="glGenerateMipmap"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glGenerateMipmap — generate a complete set of mipmaps for a texture object</p></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table class="funcprototype-table" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">void <strong class="fsfunc">glGenerateMipmap</strong>(</code></td><td>GLenum <var class="pdparam">target</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a id="parameters"></a><h2>Parameters</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>target</code></em></span></dt><dd><p>Specifies the texture target of the active texture unit to which the texture object
		    is bound whose mipmaps will be generated.  Must be one of the following
		    symbolic constants: <code class="constant">GL_TEXTURE_2D</code> or
		    <code class="constant">GL_TEXTURE_CUBE_MAP</code>.</p></dd></dl></div></div><div class="refsect1"><a id="description"></a><h2>Description</h2><p><code class="function">glGenerateMipmap</code> computes a complete set
	of mipmap arrays derived from the zero level array. Array levels up to and
	including the 1x1 dimension texture image are replaced with the derived arrays,
	regardless of previous contents.  The zero level texture image is left unchanged.</p><p>The internal formats of the derived mipmap arrays all match those of
	the zero level texture image. The dimensions of the derived arrays are computed by
	halving the width and height of the zero level texture image, then in turn halving
	the dimensions of each array level until the 1x1 dimension texture image is
	reached.</p><p>The contents of the derived arrays are computed by repeated filtered reduction
	of the zero level array. No particular filter algorithm is required, though a
	box filter is recommended.
	<a class="citerefentry" href="glHint"><span class="citerefentry"><span class="refentrytitle">glHint</span></span></a> may be called
	to express a preference for speed or quality of filtering.</p></div><div class="refsect1"><a id="errors"></a><h2>Errors</h2><p><code class="constant">GL_INVALID_ENUM</code> is generated if
	<em class="parameter"><code>target</code></em> is not <code class="constant">GL_TEXTURE_2D</code> or
	<code class="constant">GL_TEXTURE_CUBE_MAP</code>.</p><p><code class="constant">GL_INVALID_OPERATION</code> is generated if
	the texture bound to <em class="parameter"><code>target</code></em> is a cube map, but its
	six faces do not share indentical widths, heights, formats, and types.</p><p><code class="constant">GL_INVALID_OPERATION</code> is generated if
	either the width or height of the zero level array is not a power of two.</p><p><code class="constant">GL_INVALID_OPERATION</code> is generated if
	the zero level array is stored in a compressed internal format.</p></div>
        {$pipelinestall}{$examples}
        <div class="refsect1"><a id="seealso"></a><h2>See Also</h2><p><a class="citerefentry" href="glBindTexture"><span class="citerefentry"><span class="refentrytitle">glBindTexture</span></span></a>,
	<a class="citerefentry" href="glFramebufferTexture2D"><span class="citerefentry"><span class="refentrytitle">glFramebufferTexture2D</span></span></a>,
	<a class="citerefentry" href="glHint"><span class="citerefentry"><span class="refentrytitle">glHint</span></span></a>,
	<a class="citerefentry" href="glTexImage2D"><span class="citerefentry"><span class="refentrytitle">glTexImage2D</span></span></a>,
	<a class="citerefentry" href="glTexParameter"><span class="citerefentry"><span class="refentrytitle">glTexParameter</span></span></a></p></div><div class="refsect1"><div id="Copyright"><h2>Copyright</h2><p>
            Copyright © 2008 Khronos Group.
            This material may be distributed subject to the terms and conditions set forth in
            the Open Publication License, v 1.0, 8 June 1999.
            <a class="ulink" href="https://opencontent.org/openpub/" target="_top">https://opencontent.org/openpub/</a>.
        </p></div></div></div>
